Skip to content

chore(test): e2e and scenario for tabs specialEffects scrollToTop#3953

Merged
LKuchno merged 7 commits intomainfrom
@lkuchno/e2e-test-tabs-special-effects-scroll-to-top
Apr 30, 2026
Merged

chore(test): e2e and scenario for tabs specialEffects scrollToTop#3953
LKuchno merged 7 commits intomainfrom
@lkuchno/e2e-test-tabs-special-effects-scroll-to-top

Conversation

@LKuchno
Copy link
Copy Markdown
Collaborator

@LKuchno LKuchno commented Apr 29, 2026

Description

This PR adds a new Detox e2e test suite that validates the specialEffects.repeatedTabSelection.scrollToTop tab property and update the scenario e2e test section. The Detox e2e tests covers all manual steps.
New functions were added to e2e-utils.ts file to enable selecting already open tab on iOS26.2 and another one to allow run test just for android.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1190

Changes

  • FabricExample/e2e:
    Added Detox e2e test suite test-tabs-special-effects.e2e.ts covering scrollToTop: true, scrollToTop: false, and default (no specialEffects) behavior;
    Added new functions into e2e-utils: describeIfAndroid and forceTapByLabeliOS
  • apps/tests/tabs:
    Updatetest-tabs-special-effects scenario screen with e2e covarage information and index with testID values
    Update index with testIDs needed in e2e test

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an Android-scoped Detox e2e suite to validate specialEffects.repeatedTabSelection.scrollToTop behavior for tabs, and updates the associated Tabs scenario to be e2e-addressable via stable testID / accessibility labels.

Changes:

  • Add Detox e2e coverage for scrollToTop: true, false, and default behavior in the Tabs special-effects scenario.
  • Add shared e2e utilities (describeIfAndroid, tapSelectedTab) to support platform-specific tab interactions.
  • Update the Tabs scenario screen and documentation with e2e-oriented identifiers and naming.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects-scroll-to-top/scenario.md Updates scenario docs (including e2e coverage statement and screen name).
apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects-scroll-to-top/index.tsx Adds testIDs to scroll views/items and tab bar items to enable deterministic e2e selection.
FabricExample/e2e/single-feature-tests/tabs/test-tabs-special-effects-scroll-to-top.e2e.ts Introduces new Detox suite asserting repeated-tab-selection scroll-to-top behavior.
FabricExample/e2e/e2e-utils.ts Adds Android-only describe helper and a helper to tap tab items in a platform-specific way.
Comments suppressed due to low confidence (1)

apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects-scroll-to-top/index.tsx:63

  • This scrollToTop: false block is missing the trailing comma used elsewhere in this file’s multi-line object literals (e.g. the scrollToTop: true, case just above). Align formatting for consistency (and to avoid formatter churn).
      specialEffects: {
        repeatedTabSelection: {
          scrollToTop: false
        },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +7 to +13
describe('Tabs specialEffects — scrollToTop', () => {
beforeAll(async () => {
await device.reloadReactNative();
await selectSingleFeatureTestsScreen(
'Tabs',
'test-tabs-special-effects-scroll-to-top',
);
## E2E test

Other: ongoing research.
Yes: Covers all manual scenario steps.
Comment on lines 1 to +2
import { device, expect, element, by } from 'detox';
import { AndroidElementAttributes, IosElementAttributes } from 'detox/detox';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we can really do anything about it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was already trying to get rid of it and it didn't work so I kept it in this form.

Comment thread FabricExample/e2e/e2e-utils.ts Outdated
Comment on lines +78 to +88
export async function tapSelectedTab(testLabel: string) {
if (device.getPlatform() === 'ios') {
const elementAttributes = await getElementAttributes(testLabel);
const { x, y, width, height } = elementAttributes.frame;
await device.tap({
x: x + width / 2,
y: y + height / 2,
});
} else {
await element(by.label(testLabel)).tap();
}
Comment thread FabricExample/e2e/e2e-utils.ts
Comment thread FabricExample/e2e/e2e-utils.ts Outdated
Comment thread FabricExample/e2e/e2e-utils.ts
LKuchno and others added 3 commits April 30, 2026 09:49
Co-authored-by: Krzysztof Ligarski <63918941+kligarski@users.noreply.github.com>
…f github.com:software-mansion/react-native-screens into @lkuchno/e2e-test-tabs-special-effects-scroll-to-top
Copy link
Copy Markdown
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

The last suggestion I have is to add some comments to new util methods so that we know why we needed them in the future.

Comment thread FabricExample/e2e/e2e-utils.ts
LKuchno and others added 2 commits April 30, 2026 15:22
…effects-scroll-to-top.e2e.ts

Co-authored-by: Krzysztof Ligarski <63918941+kligarski@users.noreply.github.com>
Co-authored-by: Krzysztof Ligarski <63918941+kligarski@users.noreply.github.com>
@LKuchno LKuchno merged commit 150121e into main Apr 30, 2026
7 checks passed
@LKuchno LKuchno deleted the @lkuchno/e2e-test-tabs-special-effects-scroll-to-top branch April 30, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants